//*********************************************************
//
// Output Registers used:
//   oPos - The vertex output position.
//   oT0  - u_tan
//   oT1  - original UV
//   oT2  - normal
//   oT3  - original UV
//   oT4  - view vec in world space
//   oT5  - v_tan
//   oD0  - diffuse color
//   oD1  - specular color
//
// Texture Combiner Assumed
//   stage0 - base
//   stage1 - reflection
//   stage2 - emissive
//   stage3 - bump
// Result = stage0 * oD0 + oD1 + stage1 * REFLECTION_COLOR_REFLECTIVITY + stage2 * MATERIAL_EMISSIVE_OPACITY
//
//*********************************************************

m4x4 r0, inPos, c[MODEL_VIEW_PROJECTION]
mov oPos, r0

// oD0, oD1 is calculated here
#include "..\common\_diffuse.vsh"

mov oT3, inUV
mov oT1, inUV

// oT4 = normalize(CameraPos - position)
m4x4 r0, inPos, c[MODEL_MATRIX]
sub oT4, c[WORLD_SPACE_CAMERA_POS_OOFOG_RANGE], r0

// pass through transformation matrix
;mov r0.w, c[CONSTANT_0_05_1_2].z
m3x3 r0, inNormal, c[MODEL_MATRIX]
mov oT2, r0
m3x3 r0, v3, c[MODEL_MATRIX]
mov oT0, r0
m3x3 r0, v4, c[MODEL_MATRIX]
mov oT5, r0
